#!/bin/sh
#Attention! This plist genereator does not support man pages for multimple languages!
. $area51/Tools/scripts/mkplist/settings.conf

(cd $1 && find -d * \! -type d) | sort |grep -v '^man/' > pkg-plist
(cd $1 && find -d * -type d) | sort | comm -13 ${OLDDIRS} - | sort -r | sed -e 's,^,@dirrm ,' -e 's,@dirrm man/,@dirrmtry man/,' >> pkg-plist

(cd $1 && find -d * \! -type d) | sort |grep '^man/' > man-list
:> Makefile.man

if [ -s man-list ]; then
	for i in `jot 9 1` l n;	do
		grep "man/.*/man${i}/" man-list > /dev/null && \
		printf "MAN${i}=\t" >> Makefile.man && \
		echo `grep "man/.*/man${i}/" man-list|sed -e "s,man/.*/man${i}/,,g; s,\.gz$,,g"` >> Makefile.man
	done
else
	rm man-list Makefile.man
fi

#keep list of installed manuals for check
#rm man-list
